package com.asohofrucol.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.asohofrucol.model.ProcessTransferInnovation;

public interface ProcessTransferInnovationDao extends
	BasicSaveDao<ProcessTransferInnovation, Long> {
	
    @Query("SELECT p FROM ProcessTransferInnovation p WHERE p.ruat.id = :ruatId and p.status='1'")
    public List<ProcessTransferInnovation> listByRuatId(@Param("ruatId") Long ruatId);
    
    @Query("SELECT p FROM ProcessTransferInnovation p WHERE p.ruat.id = :ruatId and p.comboValueActivity.id=591 and p.status='1'")
    public List<ProcessTransferInnovation> listProductionByRuatId(@Param("ruatId") Long ruatId);    
    
    @Query("SELECT p FROM ProcessTransferInnovation p WHERE p.ruat.id = :ruatId and p.comboValueActivity.id=594 and p.status='1'")
    public List<ProcessTransferInnovation> listTransformationByRuatId(@Param("ruatId") Long ruatId);  
    
    @Query("SELECT p FROM ProcessTransferInnovation p WHERE p.ruat.id = :ruatId and p.comboValueActivity.id=597 and p.status='1'")
    public List<ProcessTransferInnovation> listMerchandisingByRuatId(@Param("ruatId") Long ruatId);  
    
    @Query("SELECT p FROM ProcessTransferInnovation p WHERE p.ruat.id = :ruatId and p.comboValueActivity.id=600 and p.status='1'")
    public List<ProcessTransferInnovation> listOrganizationalByRuatId(@Param("ruatId") Long ruatId);    
}
